Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Testing Support #1148

Closed
wants to merge 3 commits into from
Closed

Swift Testing Support #1148

wants to merge 3 commits into from

Conversation

younata
Copy link
Member

@younata younata commented Jun 17, 2024

This provides a way for Nimble to natively integrate with Swift Testing. This relies on an in-progress Swift Testing Evolution proposal that I'm actively working on. You can see that PR at swiftlang/swift-testing#481.

This branch serves as a POC that the code in swiftlang/swift-testing#481 does enough to provide a way for third party assertion tools like Nimble to natively integrate with Swift Testing and report errors. As such, as my proposal evolves, this branch will change with it. Which is why this is a draft PR.

Actual Changes

  • Nimble now records fileID and column information as part of the SourceLocation.
  • Adds a new AssertionHandler for reporting Swift Testing errors.
  • The default handler is now able to detect if a Swift Testing test is running1, and if so, it'll report the assertion failure to Swift Testing. Otherwise, it reports the failure to XCTest.
  • The new SwiftTestingAssertionHandler directly creates an Issue and uses the new-in-my-proposal Issue.record instance method.

Footnotes

  1. Kinda, see https://github.com/apple/swift-testing/issues/475.

@younata younata closed this Aug 9, 2024
@younata younata deleted the basic-swift-testing-support branch August 9, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant